Dynomotion

Group: DynoMotion Message: 9440 From: Colin Fera Date: 5/2/2014
Subject: migration to kmotion CNC from mach
Hi,

I recently migrated to kmotion CNC from mach 3 and have successfully run a few programs.  This is on a simple 3 axis mill with steppers currently open loop. I like kmotion much better than mach and it certainly seems to run faster. I also much prefer creating kmotion code in c rather than the mach macro scripting.

I do have a few questions:

First, the jog icons in kmotion seem to work intermittently. I have to re launch kmotion to get them working again. When I say not working I mean nothing is happening. The axis's don't appear to be disabled as I can still manually enter gcodes and make them all move. And re initializing kflop doesn't help. I am using pretty much the same init program that I was using with mach3.

Second, What post processor should I use and are there any critical settings other than the IJ mode. I am using HSMworks and meshcam, the mach3 post seems to work ok.

The emc post prints a G91.1 which kmotion doesn't like, though its easy to remove.

Will kmotion always do strait line rapids?

Is there a safe z equivalent in kmotion or does this need to be done using a user program?

And finally, will kmotion work with any of those mach3 usb pendants that are all over ebay?

I realize it would be less than ideal to control from the computer vs directly sending signals to the kflop.

How about run of the mill USB joysticks, as opposed to gamepads?

Thanks,
Colin 


Group: DynoMotion Message: 9442 From: Tom Kerekes Date: 5/2/2014
Subject: Re: migration to kmotion CNC from mach
Hi Colin,

Regarding:

"Jog Icons" - do you mean the on-screen Jog Buttons in KMotionCNC?  We haven't heard of any problems.  If you click them with the mouse do they depress?  What Version are you running?  Please run KMotion.exe and check if the feedhold is active when you are having the problem.

HSMworks and meshcam post processors - don't know myself.  Mach3 or EMC or LinuxCNC should be closest.

G91.1 - I think that is normally for relative IJ for Arcs.  KMotionCNC only supports that mode.  You would need to remove it

Current Versions of KMotionCNC will always do straight line 3rd order Rapids.

Currently you would need to implement SafeZ yourself.   We are taking suggestions on how best to do this. 

No KMotionCNC doesn't currently support any USB Pendents.

Hard to say if a particular Joystick would work.  KMotionCNC makes a call to Windows of:
joyGetPosEx(JOYSTICKID1,&ji)
to get the joystick position and buttons.

HTH
Regards
TK

Group: DynoMotion Message: 9444 From: Colin Fera Date: 5/2/2014
Subject: Re: migration to kmotion CNC from mach
Hi Tom,

Yes I was talking about the on screen buttons. It Appears it was the feed hold.  I didn't realize it stayed on between inits (and didn't realize it was on at all).

I tried an xbox 360 controller with the drives disabled and it drifts everywhere even after calibration. 

Is there a game pad that you recommend ?
 
Thanks,
Colin




On Fri, May 2, 2014 at 12:36 PM, Tom Kerekes <tk@...> wrote:
 

Hi Colin,

Regarding:

"Jog Icons" - do you mean the on-screen Jog Buttons in KMotionCNC?  We haven't heard of any problems.  If you click them with the mouse do they depress?  What Version are you running?  Please run KMotion.exe and check if the feedhold is active when you are having the problem.

HSMworks and meshcam post processors - don't know myself.  Mach3 or EMC or LinuxCNC should be closest.

G91.1 - I think that is normally for relative IJ for Arcs.  KMotionCNC only supports that mode.  You would need to remove it

Current Versions of KMotionCNC will always do straight line 3rd order Rapids.

Currently you would need to implement SafeZ yourself.   We are taking suggestions on how best to do this. 

No KMotionCNC doesn't currently support any USB Pendents.

Hard to say if a particular Joystick would work.  KMotionCNC makes a call to Windows of:
joyGetPosEx(JOYSTICKID1,&ji)
to get the joystick position and buttons.

HTH
Regards
TK

Group: DynoMotion Message: 9447 From: Tom Kerekes Date: 5/3/2014
Subject: Re: migration to kmotion CNC from mach
Hi Colin,

You could modify your Init to release any feed hold if you wish by adding:

    ClearStopImmediately();

Regarding GamePad Drift:  Sometimes there is a special button sequence on the control itself to zero the offsets.

KMotionCNC forces zero for Gampad Jostick values below 1600 (of +/-32767) to try to avoid drift in the function shown below.  You would need to re-comple KMotionCNC to change the value.

double CKMotionCNCDlg::DoJoyAxis(int axis, int joystick)
{
    double v;

    v = joystick-0x7fff;
    if (ThreadIsExecuting) v=0;
    if (fabs(v) < 1600) v=0;

    v *= m_JogSpeed[axis] * m_JogSpeedFactor / 32768.0;

    return v;
}

We've tested the GamePad shown here:
http://www.dynomotion.com/Help/KMotionCNC/KMotionCNC.htm#Jog_Buttons

HTH
Regards
TK



Group: DynoMotion Message: 9450 From: David Stevenson Date: 5/4/2014
Subject: Re: migration to kmotion CNC from mach
Hi All,

I use both the Logitech F310 and also the wireless version F710 all the time with KMotion and they work great.

Best Regards,
David.

On 5/3/2014 2:44 PM, Tom Kerekes wrote:
 
Hi Colin,

You could modify your Init to release any feed hold if you wish by adding:

    ClearStopImmediately();

Regarding GamePad Drift:  Sometimes there is a special button sequence on the control itself to zero the offsets.

KMotionCNC forces zero for Gampad Jostick values below 1600 (of +/-32767) to try to avoid drift in the function shown below.  You would need to re-comple KMotionCNC to change the value.

double CKMotionCNCDlg::DoJoyAxis(int axis, int joystick)
{
    double v;

    v = joystick-0x7fff;
    if (ThreadIsExecuting) v=0;
    if (fabs(v) < 1600) v=0;

    v *= m_JogSpeed[axis] * m_JogSpeedFactor / 32768.0;

    return v;
}

We've tested the GamePad shown here:
http://www.dynomotion.com/Help/KMotionCNC/KMotionCNC.htm#Jog_Buttons

HTH
Regards
TK



Group: DynoMotion Message: 9467 From: Colin Fera Date: 5/9/2014
Subject: Re: migration to kmotion CNC from mach
Hi, So I got one of these Logitech F310's. I calibrated it using windows. I have tested it only with the drives disabled. What happens is there is some movement from the DRO's on moving the sticks but pretty quickly dynomotion CNC loses communication with the kflop and kflop doesn't work until its recovered (tried just disconnecting it and even rebooting the computer). 

I am using a very old computer a ~2004 pentium 4, but windows 7 is freshly installed on a new drive and has been stable. I THINK that kflop is on a different USB bus from the controller (if that makes a difference). 

The controller has a switch for  XInput or DirectInput mode, I have only tried it in DirectInput.

Thanks,
Colin




On Sun, May 4, 2014 at 4:30 AM, David Stevenson <david.m.stevenson@...> wrote:
 

Hi All,

I use both the Logitech F310 and also the wireless version F710 all the time with KMotion and they work great.

Best Regards,
David.



On 5/3/2014 2:44 PM, Tom Kerekes wrote:
 
Hi Colin,

You could modify your Init to release any feed hold if you wish by adding:

    ClearStopImmediately();

Regarding GamePad Drift:  Sometimes there is a special button sequence on the control itself to zero the offsets.

KMotionCNC forces zero for Gampad Jostick values below 1600 (of +/-32767) to try to avoid drift in the function shown below.  You would need to re-comple KMotionCNC to change the value.

double CKMotionCNCDlg::DoJoyAxis(int axis, int joystick)
{
    double v;

    v = joystick-0x7fff;
    if (ThreadIsExecuting) v=0;
    if (fabs(v) < 1600) v=0;

    v *= m_JogSpeed[axis] * m_JogSpeedFactor / 32768.0;

    return v;
}

We've tested the GamePad shown here:
http://www.dynomotion.com/Help/KMotionCNC/KMotionCNC.htm#Jog_Buttons

HTH
Regards
TK



Group: DynoMotion Message: 9468 From: Tom Kerekes Date: 5/9/2014
Subject: Re: migration to kmotion CNC from mach
Hi Colin,

Are you saying that you actually have to do a KFLOP Flash Recovery after using the GamePad?

Regards
TK


Group: DynoMotion Message: 9469 From: Colin Fera Date: 5/9/2014
Subject: Re: migration to kmotion CNC from mach
Hi Tom,

That's correct.

Colin



Sent from my iPhone

On May 9, 2014, at 9:59 AM, "Tom Kerekes tk@... [DynoMotion]" <DynoMotion@yahoogroups.com> wrote:

 

Hi Colin,

Are you saying that you actually have to do a KFLOP Flash Recovery after using the GamePad?

Regards
TK


Group: DynoMotion Message: 9470 From: Tom Kerekes Date: 5/9/2014
Subject: Re: migration to kmotion CNC from mach
Hi Colin,

That certainly is strange.  Did you try cycling power on KFLOP?

I don't know what those modes are for.  The GamePad we recommend doesn't have those.  I read here:
http://gaming.logitech.com/en-us/product/f310-gamepad
*Requires software installation for DirectInput mode.

You might run KMotion.exe to see if there is any message on the Console.

You might also try a different, modern computer to see if the computer has a problem.

Regards
TK


Group: DynoMotion Message: 9500 From: Colin Fera Date: 5/17/2014
Subject: Re: migration to kmotion CNC from mach
Hi Tom,

Installed on a newer computer and the game pad works like a champ.

Question? 

Where would I modify the code in visual studio to move the axis's around on the game pad? What I mean is Say I want to make the right stick be the Y, the left be the X and the rear "sliders" for lack of the correct term be the Z.

In windows in the gamepad calibration the axis's are called X/Y, X rotation, Y rotation and Z axis respectively.

Thanks,
Colin


On Fri, May 9, 2014 at 10:58 AM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Colin,

That certainly is strange.  Did you try cycling power on KFLOP?

I don't know what those modes are for.  The GamePad we recommend doesn't have those.  I read here:
*Requires software installation for DirectInput mode.

You might run KMotion.exe to see if there is any message on the Console.

You might also try a different, modern computer to see if the computer has a problem.

Regards
TK


Group: DynoMotion Message: 9501 From: Tom Kerekes Date: 5/17/2014
Subject: Re: migration to kmotion CNC from mach
Hi Colin,

See the function:

int CKMotionCNCDlg::DoJoyStick()

Which calls Windows to return the structure below on the GamePad state

typedef struct joyinfoex_tag {
    DWORD dwSize;                /* size of structure */
    DWORD dwFlags;               /* flags to indicate what to return */
    DWORD dwXpos;                /* x position */
    DWORD dwYpos;                /* y position */
    DWORD dwZpos;                /* z position */
    DWORD dwRpos;                /* rudder/4th axis position */
    DWORD dwUpos;                /* 5th axis position */
    DWORD dwVpos;                /* 6th axis position */
    DWORD dwButtons;             /* button states */
    DWORD dwButtonNumber;        /* current button number pressed */
    DWORD dwPOV;                 /* point of view state */
    DWORD dwReserved1;           /* reserved for communication between winmm & driver */
    DWORD dwReserved2;           /* reserved for future expansion */
} JOYINFOEX, *PJOYINFOEX, NEAR *NPJOYINFOEX, FAR *LPJOYINFOEX;


Here is the code that maps and passes the returned values to cause motion:

        m_Joyvx = DoJoyAxis(0,       ji.dwXpos);
        m_Joyvy = DoJoyAxis(1,0xffff-ji.dwYpos);
        m_Joyvz = DoJoyAxis(2,0xffff-RtoUse   );
        m_Joyva = DoJoyAxis(3,       ZtoUse   );

HTH
Regards
TK